UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rh8bHhSvdalUOEa6gURRpjSLJ6+hUJqHXbXJW8p3bUc=' 
WHERE 
  key_id = '466bc329d7971e681b88b30081d0b990ddbe6da8f0967be08d9b3c57f335648e' 
  AND (
    token = 'Rh8bHhSvdalUOEa6gURRpjSLJ6+hUJqHXbXJW8p3bUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034