UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NWRN0N1soYJ9DHl4VhDfSrV9VeGOXweaP4LuqnWYP0='
WHERE
key_id = '0bbfa291f8856b26b50877ade6f493b6ed336407220b2683c56a08142c1ac93d'
AND (
token = '/NWRN0N1soYJ9DHl4VhDfSrV9VeGOXweaP4LuqnWYP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)