UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5BTJ9mntuyeo4zU6FezzvkQyTWbBVUVwVgduL/lFplw=' 
WHERE 
  key_id = '082467300fc6225c8e8e87906831895826430ad62251b892e1153e027c34730b' 
  AND (
    token = '5BTJ9mntuyeo4zU6FezzvkQyTWbBVUVwVgduL/lFplw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043