UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R18Z+IxBblAnZ/Y/1/KBHF4Vv9xsenQW35/I/a0j1gg='
WHERE
key_id = 'fd13073358cbc2016c4b5fc73ad4b15a19e711152a032bb2e23cad5f669f7992'
AND (
token = 'R18Z+IxBblAnZ/Y/1/KBHF4Vv9xsenQW35/I/a0j1gg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)