UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ovr69nFJGqRQxKzvmpmlM54tC+K8/Id+GI1mesNL+J4=' 
WHERE 
  key_id = '5ff193ddd4d0ca1b21caa392f305d64a4e64a4617b7e22e0c86c344db58a331a' 
  AND (
    token = 'Ovr69nFJGqRQxKzvmpmlM54tC+K8/Id+GI1mesNL+J4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022