UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j+xvW2RagPzm/L/OsDteVcGFTfRWF5HRPjqG7ZK4UYI='
WHERE
key_id = '356f79a65d1daddb2cdbc194c935a2e228740baab1b0fd87f616febd519ebcd7'
AND (
token = 'j+xvW2RagPzm/L/OsDteVcGFTfRWF5HRPjqG7ZK4UYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)