UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rrsaLgFmypf+0MLeCdhAuVy4XOzKtt/NQZQD8ve0pj4='
WHERE
key_id = 'ee5647f0ef93b4cf79aeb3c335c0668cc9665869aa75ff093ab0ec43255fb72f'
AND (
token = 'rrsaLgFmypf+0MLeCdhAuVy4XOzKtt/NQZQD8ve0pj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)