UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ZMOADYMUVq0H6D7OwWWFHIPLK6YeDh8vOspkFxleSg='
WHERE
key_id = 'e756dfb77192ccc3f62a541957b7f1e7f7464b736deccd5844028caa27773004'
AND (
token = '1ZMOADYMUVq0H6D7OwWWFHIPLK6YeDh8vOspkFxleSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)