UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9rZVskklG4OL63KBxF8+EovV+3VU9ai/IDPcv//qbL4='
WHERE
key_id = '263d553240876befac061086bd90bd14ce855e57805f2af77dd72fcab288c2e4'
AND (
token = '9rZVskklG4OL63KBxF8+EovV+3VU9ai/IDPcv//qbL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)