UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nofmuXNFJFc+trZNF00+oxMRRLq0q3mZWnyaq6w/JZc=' 
WHERE 
  key_id = 'e4097ad2b571f4142182a21bedac5bf98e6e87f4026a6571ec2bae34d9659bfc' 
  AND (
    token = 'nofmuXNFJFc+trZNF00+oxMRRLq0q3mZWnyaq6w/JZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076