UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kRpjELNzWa32C5GPEZCYVmVf8VAq/5lh9LFr3kUOkLE='
WHERE
key_id = '8226ca925ef2d7434b158e674ec870c8464a617d0cc4a89d22aae3959fbc7b8d'
AND (
token = 'kRpjELNzWa32C5GPEZCYVmVf8VAq/5lh9LFr3kUOkLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)