UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TqHrAnOzmL//MRifpaQEE4IjtBOt74DhU0/f5vfQgoU='
WHERE
key_id = '684d159accffb42a9fb2b9442245a68e9b342268b2f0a64b1c3789d17ece1a0d'
AND (
token = 'TqHrAnOzmL//MRifpaQEE4IjtBOt74DhU0/f5vfQgoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)