UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y3r+grdFafz0Ns7Ts8qvntRQWnkaLUEAbbL02ViIldI='
WHERE
key_id = '41bea19db435d2a6273829e181af44182836e824e90e426e6a9251fb4a84a0ce'
AND (
token = 'y3r+grdFafz0Ns7Ts8qvntRQWnkaLUEAbbL02ViIldI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)