UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SikffB41CLn7ozZhqzQyyse1RCA/M7pMZfFAlxvN3po='
WHERE
key_id = '9fbef4d51fb48ccea442a89e3a91cd0fdd690e1a82beff22384bca158bf8993a'
AND (
token = 'SikffB41CLn7ozZhqzQyyse1RCA/M7pMZfFAlxvN3po='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)