UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fX2N2HgIlvzKvEJnyoAxnovLKrygYt/xEajTviHUAFU='
WHERE
key_id = '3630a907730cef0fee76cecda62cd610ca70eb3d6502fdecd452b85db6d21a9d'
AND (
token = 'fX2N2HgIlvzKvEJnyoAxnovLKrygYt/xEajTviHUAFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)