UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z3mrr/88ofnwfBOG5NPf5Y3oa01tqMYj2zXcshQ5Is4='
WHERE
key_id = '3aeda0b3c72f2398e4c69890536a5c9df99bb96176a69b8d76e97d008fcf1777'
AND (
token = 'Z3mrr/88ofnwfBOG5NPf5Y3oa01tqMYj2zXcshQ5Is4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)