UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'skWaeH9LbYURqlzNy1xNvU9cZFwwMHCq0HOMft/6MBw=' 
WHERE 
  key_id = '8d7de7063201587b3585076b9949533ca17f3f82d3bec74fae5c26686d3b8226' 
  AND (
    token = 'skWaeH9LbYURqlzNy1xNvU9cZFwwMHCq0HOMft/6MBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025