UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GHWRnOXLphSdJRQO5LYMj/2V02HNZ/PTSuZQ/EUPM8w=' 
WHERE 
  key_id = '881f5ae46875b5bbac9816db727f0eff99d1a64e8ffc28d893c29116384589da' 
  AND (
    token = 'GHWRnOXLphSdJRQO5LYMj/2V02HNZ/PTSuZQ/EUPM8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036