UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e7Y3IIikGETajnyhPDFQulD2zy2bQM+sEXV2iV3EX+4=' 
WHERE 
  key_id = '32067b6b1487186cde8e1ce526fb4eee9fdc6b968f5eec63f9db048588dbe7f2' 
  AND (
    token = 'e7Y3IIikGETajnyhPDFQulD2zy2bQM+sEXV2iV3EX+4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031