UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lCY0pS0132YPQgd/qqt5eY35IVbxQLq2NMecKlTMQ2k='
WHERE
key_id = '4188d62a931300e9f98fd2d0dad5e26bfefa8e309497cec2b9a9a9d39049079f'
AND (
token = 'lCY0pS0132YPQgd/qqt5eY35IVbxQLq2NMecKlTMQ2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)