UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zr05BLAXB1i52ANf6OfRNy17JPIgQXXPkNDVPuOp31E=' 
WHERE 
  key_id = '5b975447a957af359d663ee12bfe05fcb9985eaa3d8aa0cca690fe0d0462abee' 
  AND (
    token = 'Zr05BLAXB1i52ANf6OfRNy17JPIgQXXPkNDVPuOp31E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029