UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CQ/10NmHj3jw/TzV+o+xsfbW5rGvoqyZJ4A7w2NujSg='
WHERE
key_id = 'fa3380ccb42cdbc62673bbaa8a4ad9072f4b88f33a3107aec713c7801df6000e'
AND (
token = 'CQ/10NmHj3jw/TzV+o+xsfbW5rGvoqyZJ4A7w2NujSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)