UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1mZflfwXi//61ityYwrGp2RZXzU/0hVL4JqrPlWVoQY=' 
WHERE 
  key_id = '8d15600b91ea55605b5993c8e0ebe495e956bf10ac447ef4f48c687e80e4fd19' 
  AND (
    token = '1mZflfwXi//61ityYwrGp2RZXzU/0hVL4JqrPlWVoQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032