UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '373gUbyFpwTtmQ3P5nCNdHyD79A44aLn4mKWfJRn7AU='
WHERE
key_id = 'cb3e3bf223652fb2b12d15204a3c0b0046aac47f595c548f4ae428d594a9e9ec'
AND (
token = '373gUbyFpwTtmQ3P5nCNdHyD79A44aLn4mKWfJRn7AU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)