UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IgdFVgwMxRbj+2IMCTdGB5UbSwf0ck/ikzJr1mQb9zU='
WHERE
key_id = 'cac4b4deab68c2f9d721667eb04addb9516ff00566e3e69076cfcd8d74dd417d'
AND (
token = 'IgdFVgwMxRbj+2IMCTdGB5UbSwf0ck/ikzJr1mQb9zU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)