UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '05KJDOyR4RG0xSlxyI/s8o/ieQDJJUqJz4vFikC+jO0='
WHERE
key_id = 'bb84611870a58eefbe4cbfd266843ea529beaadd870c997bab1ed81f1c91622a'
AND (
token = '05KJDOyR4RG0xSlxyI/s8o/ieQDJJUqJz4vFikC+jO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)