UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aTA4WbVJo6RuiRBQeQh426A3JsfIB8P2UxqDJf7Cy9Y=' 
WHERE 
  key_id = '35ced697ee591d5d249fa0caa441c9ba24915890729fa20221bf94009f7608ce' 
  AND (
    token = 'aTA4WbVJo6RuiRBQeQh426A3JsfIB8P2UxqDJf7Cy9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017