UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XTBpshItDqcfjgv5dkvFVoSwaDwVcyIaCDS5veEbOWg='
WHERE
key_id = '2a8632acfbae3cd6468ae234a5c61f7b8c0e9e95260e74b7ccb31cfd98b73863'
AND (
token = 'XTBpshItDqcfjgv5dkvFVoSwaDwVcyIaCDS5veEbOWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)