UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vRfLKSoPmZTDf1PXqKqg2rvq9aKB7sepQqSaBtPIEOQ='
WHERE
key_id = 'dcd92cd00e2ca8a0390f053dcd20b22b0d837b2e2bfbc8724e04e147cb20d736'
AND (
token = 'vRfLKSoPmZTDf1PXqKqg2rvq9aKB7sepQqSaBtPIEOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)